package com.wabi.action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenuItem;
import javax.swing.JOptionPane;

import com.wabi.frame.WabiFrame;

public class MenuActionListener implements ActionListener {

	@Override
	public void actionPerformed(ActionEvent e) {
		JMenuItem item = (JMenuItem)(e.getSource());
		String  command = item.getActionCommand();
		if (command.equals("Exit")){
			System.out.println("clicked exit");
			System.exit(0);
	    /*}else if (command.equals("About")){
			System.out.println("clicked about");
			JOptionPane.showMessageDialog(item.getTopLevelAncestor(), "JFrame example\nCreated by: Anna Jaworska");*/
		}else if (command.equals("SET")){
			System.out.println("settings clicked");
			WabiFrame.getTabPanel().setSelectedIndex(0);
		}else if (command.equals("AIR")){
			System.out.println("airplane clicked");
			WabiFrame.getTabPanel().setSelectedIndex(1);
		}
	}
}
